package com.code.day12;

public class Day12Exception {
    public static void main(String[] args) {
        String str = "str1.txt1";
        method(str);
        System.out.println("你好");
    }

    public static void method(String str) {
        if(!str.endsWith(".txt")){
            throw  new NullPointerException();
        }else {
            System.out.println("文件名正确");
        }
    }
}
